
<%@ page import="kioscodeal.Comercio"%>
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'comercio.label', default: 'Comercio')}" />
<title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>

	<div id="list-comercio" class="content scaffold-list" role="main">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">
					<i class="fa fa-long-arrow-right"></i>
					<g:message code="default.list.label" args="[entityName]" />
				</h3>
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-lg-12">
						<g:if test="${flash.message}">
							<div class="message" role="status">
								${flash.message}
							</div>
						</g:if>
						<g:if test="${comercioInstanceList}">
							<div class="table-responsive">
								<table class="table table-bordered table-hover tablesorter">
									<thead>
										<tr>

											<g:sortableColumn property="calle"
												title="${message(code: 'comercio.calle.label', default: 'Calle')}" />

											<g:sortableColumn property="numeroDireccion"
												title="${message(code: 'comercio.numeroDireccion.label', default: 'Numero Direccion')}" />

											<g:sortableColumn property="localidad"
												title="${message(code: 'comercio.localidad.label', default: 'Localidad')}" />

											<g:sortableColumn property="codigoPostal"
												title="${message(code: 'comercio.codigoPostal.label', default: 'Codigo Postal')}" />
												
											<g:sortableColumn property="minimoCompraGeneral"
												title="${message(code: 'comercio.minimoCompraGeneral.label', default: 'Compra mínima general')}" />

											<g:sortableColumn class="text-center" property="opciones"
												title="Opciones" />

										</tr>
									</thead>
									<tbody>
										<g:each in="${comercioInstanceList}" status="i"
											var="comercioInstance">
											<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

												<td><g:link action="show" id="${comercioInstance.id}">
														${fieldValue(bean: comercioInstance, field: "calle")}
													</g:link></td>

												<td>
													${fieldValue(bean: comercioInstance, field: "numeroDireccion")}
												</td>

												<td>
													${fieldValue(bean: comercioInstance, field: "localidad")}
												</td>

												<td>
													${fieldValue(bean: comercioInstance, field: "codigoPostal")}
												</td>
												
												<td>
													${fieldValue(bean: comercioInstance, field: "minimoCompraGeneral")}
												</td>

												<td><g:form
														url="[resource:comercioInstance, action:'delete']"
														method="DELETE">
														<fieldset class="buttons">
															<i class="fa fa-edit"></i>
															<g:link class="edit" action="edit"
																resource="${comercioInstance}">
																<g:message code="default.button.edit.label"
																	default="Edit" />
															</g:link>
															<g:actionSubmit class="delete" action="delete"
																value="${message(code: 'default.button.delete.label', default: 'Delete')}"
																onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Esta seguro?')}');" />
														</fieldset>
													</g:form></td>
											</tr>
										</g:each>
									</tbody>
								</table>
							</div>
						</g:if>
						<g:else>
								No existen Comercios dados de alta.
							</g:else>
					</div>
				</div>
			</div>
			<div>
				<div class="pagination">
					<g:paginate total="${comercioInstanceCount ?: 0}" />
				</div>
			</div>
			<div class="nav" role="navigation">
				<div class="row">
					<div class="col-lg-3"></div>
					<div class="col-lg-3">
						<a class="home" href="${createLink(uri: '/')}"><g:message
								code="default.home.label" /></a>
					</div>
					<div class="col-lg-3">
						<g:link class="create" action="create">
							<g:message code="default.new.label" args="[entityName]" />
						</g:link>
					</div>
					<div class="col-lg-3"></div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
